package cn.stronglink.asset.module.maintenant.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.plugins.Page;
import cn.stronglink.asset.module.maintenant.service.MaintenantService;
import cn.stronglink.asset.module.maintenant.vo.MaintenantVo;
import cn.stronglink.suite.core.base.AbstractController;

@Controller
@RequestMapping(value = "maintenant")
public class MaintenantControler extends AbstractController {
	
	@Autowired
	private MaintenantService maintenantService;
	
	
	@RequestMapping(value = "getListByParams")
	public ResponseEntity<ModelMap> getListByParams(ModelMap modelMap, HttpServletRequest request,
			HttpServletResponse response,@RequestBody Map<String, Object> params) {
		@SuppressWarnings("unchecked")
		Page<MaintenantVo> page = (Page<MaintenantVo>) super.getPage(params);
		Page<MaintenantVo> list = maintenantService.getListByParams(page,params);
		return setSuccessModelMap(modelMap, list);
	} 
	
}
